#ifndef KUOZHANG_H
#define KUOZHANG_H
#include "persent/gamepersent.h"
#include "QRunnable"
#include "QRectF"
#include "bean/jiuyuanbean.h"

class KuoZhang : public GamePersent,public CallBack,public QRunnable
{
    Q_OBJECT

    enum Statue{
        StatueGoGroup  =1,
        StatueStart = 2,
        StatueTaskType = 3,
        StatueTaskOut = 4,
        StatueGoFuBen = 5,
        StatueBack = 6,
        StatueFinish = 7
    };
private:
    RoleBean *currentRole = nullptr;
    QList<RoleBean*> *roleBeans;
    QRectF qRectF;
    JiuYuanBean jiuYuanBean;
    //该路径中最后一个城市的英文名字
    int getTaskType();
    int kuoZhangState = StatueGoGroup;

public:
    explicit KuoZhang(QWidget *parent = nullptr);

    void initData(QList<RoleBean*> *roleBean);

private:
    void goTongFuRong();
    int getTask(); //0 结束任务  1 已放弃任务
    void outGroup();
    void clickSure();
    //任务列表中查找扩张任务的位值
    void findKuoZhang4List();
    void goRemote();//从校尉到门派出
    void goFuBen(); //进入副本
    void goChuanSong();
    void outJiuYuanFuBen();// 退出救援副本
    void back(); //返回自己的城市
    void jiuyuan();
    void xiaochang();
    void abandonTask();//放弃任务
    void sendMessage(); //结交信任务
    int hasTask(); //已接受任务

    QList<QPoint *> * getTongRenXiangPath();
    QList<QPoint *> * getXiaoChangPath();
    void callBack(QString str = "") override;
    bool isCancelTask() override;
    void run() override;

};

#endif // KUOZHANG_H
